﻿using System;
using System.IO;
using System.Reflection;
using System.Windows.Forms;
using Kimgwajang.MidnightPeach.Properties;
using System.Diagnostics;
using Kimgwajang.MidnightPeach.Utilities;

namespace Kimgwajang.MidnightPeach.Forms
{
    internal partial class AboutForm : Form
    {
        public AboutForm()
        {
            InitializeComponent();
        }

        protected override void OnShown(EventArgs e)
        {
            base.OnShown(e);

            Text = Resources.About;
            labelProductName.Text = Resources.ProductName;
            labelVersion.Text = String.Format("{0} {1}.{2} ", Resources.Version, Utility.Version.Major, Utility.Version.Minor);
            labelCopyright.Text = Resources.Copyright;
            lblHomePage.Text = Resources.HomePage;
            lblHomePage.LinkArea = new LinkArea(0, lblHomePage.Text.Length);
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void lblEmail_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            Process.Start("mailto://" + lblEmail.Text);
        }

        private void lblHomePage_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            Process.Start(lblHomePage.Text);
        }
    }
}